this.connect('value-changed', this._valueChanged.bind(this));
}
- setValue(value) {
+ get value() {
+ return this._value;
+ }
+
+ set value(value) {
if (isNaN(value))
throw TypeError('The bar level value must be a number');
this.actor.queue_repaint();
}
- setMaximumValue(value) {
+ // eslint-disable-next-line camelcase
+ get maximum_value() {
+ return this._maxValue;
+ }
+
+ // eslint-disable-next-line camelcase
+ set maximum_value(value) {
if (isNaN(value))
throw TypeError('The bar level max value must be a number');
this.actor.queue_repaint();
}
- setOverdriveStart(value) {
+ // eslint-disable-next-line camelcase
+ get overdrive_start() {
+ return this._overdriveStart;
+ }
+
+ // eslint-disable-next-line camelcase
+ set overdrive_start(value) {
if (isNaN(value))
throw TypeError('The overdrive limit value must be a number');
if (value > this._maxValue)
_valueChanged() {
this._customAccessible.notify("accessible-value");
}
-
- get value() {
- return this._value;
- }
};
Signals.addSignalMethods(BarLevel.prototype);
set level(value) {
this._level = Math.max(0, Math.min(value, this._maxLevel));
- this.setValue(this._level / 100);
+ this.value = this._level / 100;
}
get maxLevel() {
set maxLevel(value) {
this._maxLevel = Math.max(100, value);
- this.setMaximumValue(this._maxLevel / 100);
+ this.maximum_level = this._maxLevel / 100;
}
};
let visible = this._proxy.Brightness >= 0;
this._item.visible = visible;
if (visible)
- this._slider.setValue(this._proxy.Brightness / 100.0);
+ this._slider.value = this._proxy.Brightness / 100.0;
}
};
_updateVolume() {
let muted = this._stream.is_muted;
- this._slider.setValue(muted ? 0 : (this._stream.volume / this._control.get_vol_max_norm()));
+ this._slider.value = muted
+ ? 0 : (this._stream.volume / this._control.get_vol_max_norm());
this.emit('stream-updated');
}
_amplifySettingsChanged() {
this._allowAmplified = this._soundSettings.get_boolean(ALLOW_AMPLIFIED_VOLUME_KEY);
- if (this._allowAmplified)
- this._slider.setMaximumValue(this.getMaxLevel() / 100);
- else
- this._slider.setMaximumValue(1);
+ this._slider.maximum_level = this._allowAmplified
+ ? this.getMaxLevel() / 100 : 1;
if (this._stream)
this._updateVolume();